﻿Imports DTO
Imports System.Data.OleDb
Public Class PhieuThuDAO
   
    Public Shared Sub LapBangPhieuThu(ByVal KhachHang As BangKhachHangDTO, ByVal dtNgayThu As DateTime, ByVal SoTienThanhToan As Double)
        Dim Connection As OleDbConnection = DataProvider.ConnectDB()
        Dim sql As String = "insert into PHIEUTHU(MaKhachHang,NgayThuTien,SoTienThu) values(@MaKhachHang,@NgayThuTien,@SoTienThu)"
        Dim cmd As OleDbCommand = New OleDbCommand(sql, Connection)
        Dim para As OleDbParameter = cmd.Parameters.Add("@MaKhachHang", OleDbType.Integer)
        para.Value = KhachHangDAO.LayMaKHachHang(KhachHang)
        para = cmd.Parameters.Add("@NgayThuTien", OleDbType.Date)
        para.Value = dtNgayThu

        para = cmd.Parameters.Add("@SoTienThu", OleDbType.Double)
        para.Value = SoTienThanhToan
        cmd.ExecuteNonQuery()
    End Sub

End Class
